DEBUG=$OHOS_DEBUG
IS_SA=$OHOS_STANDALONE
MODE=release

if [[ $DEBUG == "true" ]]; then
    MODE=debug
fi

if [[ $IS_SA == true ]]; then
    export LD_LIBRARY_PATH=$OHOS_PATH/prebuilts/clang/ohos/linux-x86_64/llvm/lib
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/x64.$MODE/thirdparty/icu
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/x64.$MODE/lib.unstripped/arkcompiler/ets_runtime
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/x64.$MODE/lib.unstripped/clang_x64/thirdparty/icu
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/x64.$MODE/arkcompiler/ets_frontend
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/x64.$MODE/arkcompiler/runtime_core
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/x64.$MODE/arkcompiler/ets_runtime
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/x64.$MODE/test/test
else
    export LD_LIBRARY_PATH=$OHOS_PATH/prebuilts/clang/ohos/linux-x86_64/llvm/lib
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/prebuilts/ohos-sdk/linux/11/toolchains
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/rk3568/clang_x64/lib.unstripped/clang_x64/thirdparty/zlib
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/rk3568/clang_x64/lib.unstripped/clang_x64/thirdparty/icu
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/rk3568/clang_x64/lib.unstripped/clang_x64/arkcompiler/ets_runtime
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/rk3568/clang_x64/arkcompiler/ets_frontend
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/rk3568/clang_x64/arkcompiler/runtime_core
    if [[ $DEBUG == "true" ]]; then
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/rk3568/clang_x64/exe.unstripped/clang_x64/arkcompiler/ets_runtime
    else
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/rk3568/clang_x64/arkcompiler/ets_runtime
    fi
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OHOS_PATH/out/rk3568/clang_x64/lib.unstripped/clang_x64/test/test
fi

export PATH=$PATH:$LD_LIBRARY_PATH

cd /mnt/data/z30052111/ohos/standalone/out/x64.debug
/mnt/data/z30052111/ohos/standalone/out/x64.debug/tests/unittest/arkcompiler/ets_runtime/PGOProfilerTest --gtest_break_on_failure --gtest_filter=PGOProfilerTest.PGOMaxCollectionTimesIsThree
# gdb --args /mnt/data/z30052111/ohos/standalone/out/x64.debug/tests/unittest/arkcompiler/ets_runtime/PGOProfilerTest --gtest_break_on_failure
